<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let p = new Promise((resolve, rejected) => {
            rejected("失败了")
        })
        let result = p.then(res => { }, err => {
            console.log('onRejcted执行了');
            // return "hope"  //返回一个
            // return new Promise((resolve,rejected)=>{
            //     resolve("返回成功的promise")
                
            // })

            return new Promise((resolve,rejected)=>{
                rejected("返回失败的promise")
            })

        })
        console.log(result)
    </script>
</body>

</html>